//
//  MathViewController.m
//  Education
//
//  Created by HUA on 15/7/14.
//  Copyright (c) 2015年 HUA. All rights reserved.
//

#import "MathViewController.h"
#import "Backgroundimageview.h"
#import "EaseViewController.h"
@interface MathViewController ()

@end

@implementation MathViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    UIImageView *backimageview = [[UIImageView alloc] initWithFrame:[UIScreen mainScreen].bounds];
    backimageview.image = [UIImage imageNamed:@"14-150602103554210.jpg"];
    backimageview.userInteractionEnabled = YES;
    [self.view addSubview:backimageview];
    
    [self addButton:[UIButton buttonWithType:UIButtonTypeCustom] target:self action:@selector(easebuttonAction) frame:CGRectMake(kScreenWidth/4, 64 + 30 , kScreenWidth/2, kScreenHeight/8 ) title:@"牛刀小试"];
    
    [self addButton:[UIButton buttonWithType:UIButtonTypeCustom] target:self action:@selector(mediatebuttonAction) frame:CGRectMake(kScreenWidth/4, 94 + 30 + kScreenHeight/8, kScreenWidth/2, kScreenHeight/8 ) title:@"锋芒初露"];
    [self addButton:[UIButton buttonWithType:UIButtonTypeCustom] target:self action:@selector(masterbuttonAction) frame:CGRectMake(kScreenWidth/4, 94 + 60 + 2 * kScreenHeight/8 , kScreenWidth/2, kScreenHeight/8 ) title:@"谁与争锋"];
    
    
    
}



//封装button的方法
- (void)addButton:(UIButton *)button target:(id)target action:(SEL)action frame:(CGRect)frame title:(NSString *)title
{
    button.frame = frame;
    button.alpha  = 0.8;
    [button setTitle:title forState:UIControlStateNormal];
    [button setTitleColor:[UIColor orangeColor] forState:UIControlStateNormal];
    button.titleLabel.font = [UIFont boldSystemFontOfSize:30];
    button.backgroundColor = [UIColor brownColor];
    button.layer.masksToBounds = YES;
    button.layer.cornerRadius = button.frame.size.height/2;
    [button addTarget:self action:action forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button];
}





#pragma mark =================按钮方法=======================

//初级按钮的方法
- (void)easebuttonAction
{

    EaseViewController *easeVc = [[EaseViewController alloc] init];
    [self presentViewController:easeVc animated:YES completion:nil];

}

//中级按钮的方法
- (void)mediatebuttonAction
{

    NSLog(@"中级战斗");


}

//高级按钮的方法
- (void)masterbuttonAction
{

    NSLog(@"高级战斗");


}




- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];

}


@end
